<!-- 左侧菜单栏伸缩按钮组件 -->
<template>
	<div @click="handleClick">
		<eco-icon :icon="icon"></eco-icon>
	</div>
</template>

<script setup lang="ts">
import {onMounted, ref, watch } from 'vue'

const screenWidth = ref(0)

const handleClick = () => {
	//appStore.setSidebarOpened()
}

onMounted(() => {
	window.addEventListener('resize', () => {
		screenWidth.value = document.body.clientWidth
	})
})

watch(screenWidth, (value, oldValue) => {
	if (oldValue > value && value < 1000) {
		//appStore.setSidebarStatus(false)
	} else if (oldValue < value && value > 1000) {
		//appStore.setSidebarStatus(true)
	}
})
//const icon = computed(() => (appStore.sidebarOpened ? 'icon-outdent' : 'icon-indent'))
const icon = 'icon-outdent' 
</script>
